package com.nami.ucenter.client.api;

import com.nami.basic.dto.MultiResponse;
import com.nami.basic.dto.Response;
import com.nami.basic.dto.SingleResponse;
import com.nami.gate.external.basic.cache.user.DeviceInfo;
import com.nami.gate.external.basic.cache.user.UserDeviceRel;
import com.nami.ucenter.client.request.UserDeviceDelCmd;
import com.nami.ucenter.client.response.UserWithDeviceInfoDTO;
import com.nami.ucenter.client.response.UserDTO;

import java.util.List;
import java.util.Map;

public interface UserReadClient {

    /**
     * 获取用户信息
     *
     * @param appKey
     * @param userId
     * @return
     */
    SingleResponse<UserDTO> getByUserId(String appKey, String userId);

    /**
     * 获取用户信息
     *
     * @param userIds
     * @return
     */
    MultiResponse<UserDTO> listByUserIds(List<String> userIds);

    /**
     * 获取用户信息
     *
     * @param userId
     * @return
     */
    SingleResponse<UserDTO> getByUserId(String userId);

    /**
     * 获取多个用户
     *
     * @param userIds
     * @return
     */
    SingleResponse<Map<String, UserDTO>> mapByUserIds(List<String> userIds);

    /**
     * 获取用户信息
     *
     * @param mobile
     * @return
     */
    SingleResponse<UserDTO> getByMobile(String mobile);

    /**
     * 账号
     *
     * @param account
     * @return
     */
    SingleResponse<UserDTO> getByAccount(String account);

    SingleResponse<UserWithDeviceInfoDTO> getUserInfoFromCacheOrDB(String appKey, String userId);
    Response removeOfflineDevice(UserDeviceDelCmd request);
    MultiResponse<DeviceInfo> getOnlDevices(String appKey, String userId);
    MultiResponse<UserDeviceRel> listUsersWithAttachedDevicesWhenOnline(String appKey, List<String> userIds);

}
